{% extends 'home/home.html' %}
{% block index %}
{% load static %}
<div class="uk-section uk-margin-medium-top uk-container uk-margin-top-large" style="padding:10px">
    <div class="uk-margin-medium uk-grid" uk-grid="">
        <div class="uk-width-1-1 uk-width-1-1@s">
            <article class="uk-article" style="padding-bottom: 4em;">
                <h2 class="uk-article-title uk-text-center" style="color: #909">
                    <strong>
                        {{ training_type }}练习
                    </strong>
                </h2>
                {% if "sc" in training_type %}
                <a href="https://create.codelab.club/projects/editor/" target="_blank"
                    class="uk-button uk-button-primary uk-width-1-1" style="background-color:#099">点我开始创作</a>
                {% endif %}
                {% if trainings %}
                {% for lv,values in trainings.items %}
                <h3 class="uk-text-center" style="color: #099">
                    <span>
                        <strong>
                            {{lv}}
                        </strong>
                    </span>
                    <hr class="uk-divider-icon uk-text-center">
                </h3>
                {% for key,ts in values.items %}
                <table class="uk-table uk-table-striped uk-table-hover uk-table-small">
                    <thead>
                        <tr class="uk-text-lead " style="font-weight:bold;">
                            <th style="font-size: 1em;font-weight:bold;text-align: left; width: 100px;">序号</th>
                            <th style="font-size:  1em;font-weight:bold;word-break: keep-all;" class="uk-text-center">练习名称</th>
                            <th style="font-size: 1em;font-weight:bold;text-align: center; width: 100px;">等级</th>
                            <th class="uk-text-right" style="font-size:  1em;font-weight:bold; width: 200px;">更新日期</th>
                        </tr>
                    </thead>
                    <h3 class="uk-h3 uk-text-center">lv{{ ts.0.id }}</h3>
                    <tbody>
                        {% for training in ts %}
                        {% if training.show %}{# 展示可以显示的 #}
                        <tr>
                            <td style="text-align:left;font-size:16px;font-weight: bold" >{{ training.cnt }}</td>
                            <td>
                                <a href="{{ training.url }}?next={{ request.GET.next }}" target="_blank">
                                    <dt class="uk-text-normal uk-text-primary" style="font-size: 16px;">
                                        {{ training.name }}
                                    </dt>
                                </a>
                            </td>
                            <td style="text-align:center;font-weight:bold">{{ training.id }}</td>
                            <td class="uk-text-right" style="font-size: 16px;">{{ training.mtime }}</td>
                        </tr>
                        {% endif %}
                        {% endfor%}
                        {% endfor %}
                    </tbody>
                </table>
                {% endfor %}
                {% else %}
                <p>这里空无一人。</p>
                {% endif %}

            </article>

        </div>

    </div>

</div>
{% endblock %}